namespace Plugins.Interfaces
{
    using System;
    using System.Collections.Generic;

    public interface IPluginService<T> :
        IPluginServiceProvider<IPluginService<T>>,
        IPluginServiceProvider<IPluginService>,
        IPluginService
    {
        T GetService(Type type, int index);
        T GetService(int index);

        IEnumerable<T> GetServices();
        IEnumerable<T> GetServices(Type type);

        bool Register(Type type, T item);
        bool Register(IPluginServiceManager manager, T item);

        bool Unregister(Type type, T item);
        bool Unregister(IPluginServiceManager manager, T item);

        int Count { get; }

        void Register<TDelegate>(T target, string action, TDelegate delegateMethod);
        void Unregister<TDelegate>(T target, string action, TDelegate delegateMethod);

        void Invoke<TDelegate>(string action, Action<TDelegate> actionMethod);
    }
}

